﻿using System.Threading.Tasks;
using ABPMPATest.Controllers;
using ABPMPATest.PhoneBooks;
using ABPMPATest.PhoneBooks.Dtos;
using Microsoft.AspNetCore.Mvc;

namespace ABPMPATest.Web.Controllers
{
    public class PersonsController : ABPMPATestControllerBase
    {
        private readonly IPersonAppService _personAppService;

        public PersonsController(IPersonAppService personAppService)
        {
            _personAppService = personAppService;
        }


        public async Task<IActionResult> Index(GetPersonInput input)
        {
            var dtos = await _personAppService.GetPagedPersonAsync(input);
            return View(dtos);
        }
    }
}